﻿using System;
using System.Runtime.Serialization;
using NCMIS.ObjectModel.MetaData;

namespace NCMIS.ObjectModel
{
    /// <summary>
    /// Provides an alternative representation of a document. Alternative representations could be a preview
    /// of a document, enabling clients to preview a document without downloading the full content.
    /// </summary>
    [DataContract(Namespace = CmisNs.Cmis)]
    public class Rendition
    {
        /// <summary>
        /// Identifies the rendition stream. (Required)
        /// </summary>
        [DataMember(Name = "streamId")]
        public string StreamId
        {
            get;
            set;
        }

        /// <summary>
        /// The MIME type of the rendition stream. (Required)
        /// </summary>
        [DataMember(Name = "mimetype")]
        public string MimeType
        {
            get;
            set;
        }

        /// <summary>
        /// The length of the rendition stream in bytes. (Optional)
        /// </summary>
        [DataMember(Name = "length")]
        public string Length
        {
            get;
            set;
        }

        /// <summary>
        /// A categorization <see cref="System.String"/> associated with the rendition. (Optional)
        /// </summary>
        [DataMember(Name = "kind")]
        public string Kind
        {
            get;
            set;
        }

        /// <summary>
        /// Human readable information about the rendition. (Optional)
        /// </summary>
        [DataMember(Name = "title")]
        public string Title
        {
            get;
            set;
        }

        /// <summary>
        /// Typically used for 'image' renditions (expressed as pixels). 
        /// Should be present if kind = cmis:thumbnail. (Optional)
        /// </summary>
        [DataMember(Name = "height")]
        public string Height
        {
            get;
            set;
        }

        /// <summary>
        /// Typically used for 'image' renditions (expressed as pixels). 
        /// Should be present if kind = cmis:thumbnail. (Optional)
        /// </summary>
        [DataMember(Name = "width")]
        public string Width
        {
            get;
            set;
        }

        /// <summary>
        /// If specified, then the rendition can also be accessed as a document
        /// object in the CMIS services. If not set, then the rendition can only
        /// be accessed via the rendition services. Referential integrity of this
        /// ID is repository-specific. (Optional)
        /// </summary>
        [DataMember(Name = "renditionDocumentId")]
        public string RenditionDocumentId
        {
            get;
            set;
        }
    }
}
